﻿using MetroNextTools.NData;
using MetroNextTools.NPanel;
using Windows.UI.Xaml;

namespace MetroNextTools.NBase
{
    /// <summary>
    /// 产生内容的接口
    /// </summary>
    internal interface INGeneratorHost
    {
        /// <summary>
        /// 所有元素的集合
        /// </summary>
        NCollection Items { get; }

        /// <summary>
        /// 承载元素的Panel
        /// </summary>
        NCollectionPanel ItemsHost { get; }
        /// <summary>
        /// 判断是不是提供的container类型
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        bool IsItemItsOwnContainer(object item);

        /// <summary>
        /// 根据数据结构取出集合列表中相应Item的容器
        /// </summary>
        /// <param name="item"></param>
        /// <param name="recycledContainer"></param>
        /// <returns></returns>
        DependencyObject GetContainerForItem(object item, DependencyObject recycledContainer);

        /// <summary>
        /// 为数据结构准备容器
        /// </summary>
        /// <param name="container"></param>
        /// <param name="item"></param>
        void PrepareItemContainer(DependencyObject container, object item);
        
        /// <summary>
        /// 清空数据结构的容器
        /// </summary>
        /// <param name="container"></param>
        /// <param name="item"></param>
        void ClearContainerForItem(DependencyObject container, object item);

        /// <summary>
        /// 判断是不是这个程序的宿主
        /// </summary>
        /// <param name="container"></param>
        /// <returns></returns>
        bool IsHostForItemContainer(DependencyObject container);
    }
}
